package 牛客;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-09-08
 * Time: 20:28
 */
import java.util.*;

public class 统计回文{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String A = scanner.next();
        String B = scanner.next();
        int lenA = A.length();
        int lenB = B.length();
        char[] q = new char[lenA + lenB];
        for(int i = 0; i < lenA; i++){
            q[i] = A.charAt(i);
        }
        int res = 0;
        for(int i = 0; i <= lenA; i++){
            char[] tmp = new char[lenA + lenB];
            for(int z = 0; z < lenA + lenB; z++){
                tmp[z] = q[z];
            }
            int k = 0;
            int j = 0;
            for(j = i; j < i + lenB; j++){
                tmp[j] = B.charAt(k++);
            }
            k = lenA - 1;
            for(int l = lenA + lenB - 1; l >= i + lenB; l--){
                tmp[l] = A.charAt(k--);
            }
            if(isHW(tmp)){
                res++;
            }
        }
        System.out.println(res);
    }

    private static boolean isHW(char[] q){
        int len = q.length;
        int i = 0;
        int j = len - 1;
        while(i < j){
            if(q[i] != q[j]){
                return false;
            }
            i++;
            j--;
        }
        return true;
    }
}
